﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MainTemplate.Master" AutoEventWireup="true" CodeBehind="Course.aspx.cs" Inherits="Enterprise.Admin.Course" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../Content/Widget/kindeditor/kindeditor-min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../Content/Widget/kindeditor/lang/zh_CN.js" type="text/javascript" charset="utf-8"></script>
    <script src="../Content/Widget/kindeditor/plugins/code/prettify.js" type="text/javascript" charset="utf-8"></script>
    <link href="../Content/Widget/kindeditor/plugins/code/prettify.css" rel="stylesheet" />
    <script src="../Content/Widget/jquery.json.min.js" type="text/javascript" charset="utf-8"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="edit_setting">
        <form id="edit_setting_form">
            <p class="multi-language">
                <label>语言：</label><select id="edit_setting_language" name="CoLanguage" class="easyui-combobox" data-options="required:true">
                    <option value="zh_cn">简体中文</option>
                    <option value="en_us">美国英语</option>
                </select>
                <input name="action" value="CoCourse" type="hidden" />
            </p>
            <p style="padding: 0 40px;">
                <textarea id="edit_setting_value" name="CoCourse">
                </textarea>
            </p>
        </form>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#edit_setting').panel({
                fit: true,
                title: '修改发展历程',
                closable: true,
                closed: true,
                tools: [{
                    iconCls: 'icon-save',
                    handler: function () {
                        editSettingValue.sync();
                        $.ajax({
                            type: "POST",
                            url: "Handle/EditSetting.aspx",
                            data: $("#edit_setting_form").serialize(),
                            success: function (msg) {
                                $.messager.show({
                                    title: '提示',
                                    msg: msg.message,
                                    timeout: 5000,
                                    showType: 'fade'
                                });
                            },
                            error: function () {
                                $.messager.show({
                                    title: '提示',
                                    msg: '修改失败！',
                                    timeout: 5000,
                                    showType: 'fade'
                                });
                            }
                        });
                    }
                }]
            });
            $('#edit_setting_form').form({
                onBeforeLoad: function () {
                    $('#edit_setting').panel("close");
                },
                onLoadSuccess: function (data) {
                    editSettingValue.html(data.Value);
                    $('#edit_setting').panel("open");
                },
                onLoadError: function () {
                    $.messager.show({
                        title: '提示',
                        msg: '加载失败！',
                        timeout: 5000,
                        showType: 'fade'
                    });
                }

            });
            $('#edit_setting_language').combo({
                onChange: function (newValue) {
                    $('#edit_setting_form').form('load', 'Handle/GetSettingDetailsJson.aspx?CoLanguage=' + newValue + '&action=CoCourse');
                }
            });
            $('#edit_setting_form').form('load', 'Handle/GetSettingDetailsJson.aspx?CoLanguage=zh_cn&action=CoCourse');
            var editSettingValue = window.KindEditor.create('#edit_setting_value', {
                uploadJson: "Handle/KindEditorUploadJson.aspx",
                fileManagerJson: "Handle/KindEditorFileManagerJson.aspx",
                width: '700px',
                height: '400px',
                filterMode: false,
                allowFileManager: true,
                afterCreate: function () {
                }
            });
        });
    </script>
</asp:Content>
